package com.ideal.manage.esms.bean.project;

import com.ideal.manage.esms.bean.sys.User;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by 83730 on 2018/3/30.
 */
@Entity
@Table(name = "sys_parameter_info")
public class ParameterInfo implements Serializable {
    public static final int CAN = 1;
    public static final int MODBUS = 2;
    public static final int CAN_CAL = 3;
    public static final int MODBUS_CAL = 4;
    public static final int DIAGNOSE = 5;

    public static final int OBJECT_NAME_PROJECT = 1;
    public static final int OBJECT_NAME_BATTERY_PACK = 2;
    public static final int OBJECT_NAME_BATTERY_GROUP = 3;
    public static final int OBJECT_NAME_CONVERTER = 4;
    public static final int OBJECT_NAME_BATTERY = 5;
    public static final int OBJECT_NAME_SYSTEM = 6;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    private String id;
    private String code;//编号
    private String name;//名称
    private Integer objName;//使用对象 1、项目 2、电池包 3、电池模组 4、变流器 5、电池单体 6、平台
    private Integer objType;//所属类别
    private Integer propertyType;//类型
    private String unit;//单位
    private Integer source;//来源
    private Integer isShow;//是否展示
    private String esName;//接口查询字段名
    private Long esAggsMethod;//参数统计方法
    private Date createTime;//创建时间
    private Date updateTime;//更新时间

    @ManyToOne
    @JoinColumn(name = "CREATE_USER")
    private User createUser;
    private Integer isValid;

    @Transient
    private Double value;   // 用于存储从es中取出的对应的值

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getObjName() {
        return objName;
    }

    public void setObjName(Integer objName) {
        this.objName = objName;
    }

    public Integer getObjType() {
        return objType;
    }

    public void setObjType(Integer objType) {
        this.objType = objType;
    }

    public Integer getPropertyType() {
        return propertyType;
    }

    public void setPropertyType(Integer propertyType) {
        this.propertyType = propertyType;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Integer getSource() {
        return source;
    }

    public void setSource(Integer source) {
        this.source = source;
    }

    public Integer getIsShow() {
        return isShow;
    }

    public void setIsShow(Integer isShow) {
        this.isShow = isShow;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public User getCreateUser() {
        return createUser;
    }

    public void setCreateUser(User createUser) {
        this.createUser = createUser;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public String getEsName() {
        return esName;
    }

    public void setEsName(String esName) {
        this.esName = esName;
    }

    public Long getEsAggsMethod() {
        return esAggsMethod;
    }

    public void setEsAggsMethod(Long esAggsMethod) {
        this.esAggsMethod = esAggsMethod;
    }

    public Double getValue() {
        return value;
    }

    public void setValue(Double value) {
        this.value = value;
    }
}
